﻿// -----------------------------------------------------------------------
// <copyright file="ModelRautes.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace TrainsAndTimeTables.Models
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.ComponentModel;
using System.Collections.ObjectModel;
using RailroadDal;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class ModelRautes : INotifyPropertyChanged
    {
        private ObservableCollection<Station> stations;
        private List<TimeTableEntery> timeTable;

       

        public List<TimeTableEntery> TimeTable
        {
            get
            {
                return timeTable;
            }
        }

        public void GenerateTimeTable(int rauteId) 
        {
            timeTable = RailroadDao.CreateTimeTable(rauteId);
        }

        public ObservableCollection<Station> Stations
        {
            get
            {
                if (stations == null)
                {
                    stations = new ObservableCollection<Station>(RailroadDao.GetAllStations());
                }
                return stations;
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }
}
